﻿namespace GuiMailAmazon
{
    using DevComponents.DotNetBar;
    using DevComponents.DotNetBar.Controls;
    using DevComponents.DotNetBar.Metro;
    using GuiMailAmazon.Properties;
    using HTMLWYSIWYG;
    using OsPortal;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.IO;
    using System.Runtime.InteropServices;
    using System.Text;
    using System.Threading;
    using System.Windows.Forms;

    public class main : MetroForm
    {
        private ButtonX btnClear;
        private ButtonX btnDelete;
        private ButtonX btnImportEmail;
        private ButtonX btnLoadConfig;
        private ButtonX btnLoadTemplate;
        private ButtonX btnSaveConfig;
        private ButtonX btnSaveEmail;
        private ButtonX btnSaveTemplate;
        private ButtonX btnSendAllMail;
        private ButtonX btnTestSendMail;
        private ButtonItem buttonItem1;
        private IContainer components = null;
        private DataGridViewTextBoxColumn Email_User;
        private GroupBox groupBox1;
        private GroupPanel groupPanel1;
        private GroupPanel groupPanel2;
        private GroupPanel groupPanel3;
        private DataGridView grv_EmailList;
        private LabelX labelX1;
        private LabelX labelX2;
        private LabelX labelX3;
        private LabelX labelX4;
        private LabelX labelX5;
        private LabelX labelX6;
        private LabelX labelX7;
        private LabelX labelX8;
        private LabelX labelX9;
        private ToolStripStatusLabel lblStatusSendMail;
        private MetroShell metroShell1;
        private MetroTabPanel metroTabPanel1;
        private MetroTabPanel metroTabPanel2;
        private MetroTabPanel metroTabPanel3;
        private DataGridViewTextBoxColumn Name_User;
        private Panel panel1;
        private Panel panel2;
        private PictureBox pictureBox1;
        private QatCustomizeItem qatCustomizeItem1;
        private StatusStrip statusStrip1;
        private static string strClassName = "main";
        private MetroTabItem tab_about;
        private MetroTabItem tab_config;
        private MetroTabItem tab_mailer;
        private TextBoxX textBoxX1;
        private TextBoxX textBoxX2;
        private TextBoxX textBoxX3;
        private ToolStripProgressBar toolStripProgressBar1;
        private ToolStripStatusLabel toolStripStatusLabel2;
        private htmlwysiwyg txtContent;
        private TextBoxX txtHostEmail;
        private RichTextBox txtLogs;
        private TextBoxX txtPassWord;
        private TextBoxX txtSendMail;
        private TextBoxX txtSendName;
        private TextBox txtSubject;
        private TextBoxX txtUserName;
        private WebBrowser webBrowser1;

        public main()
        {
            this.InitializeComponent();
            this.loadConfig();
            this.grv_EmailList.DataSource = GetTable();
            this.webBrowser1.Url = new Uri("http://thegioiphaidep.vn/mysite.html");
        }

        private void btnClear_Click(object sender, EventArgs e)
        {
            this.txtUserName.Text = "";
            this.txtPassWord.Text = "";
            this.txtHostEmail.Text = "";
            this.txtSendMail.Text = "";
            this.txtSendName.Text = "";
            this.txtUserName.Focus();
        }

        private void btnImportEmail_Click(object sender, EventArgs e)
        {
            try
            {
                OpenFileDialog dialog = new OpenFileDialog
                {
                    Title = "Open Text File",
                    Filter = "CSV (*.csv)|*.csv|Excel 2003 (.xls)|*.xls|Excel 2007 (*.xlsx)|*.xlsx",
                    InitialDirectory = @"C:\"
                };
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    DataTable table;
                    if (Path.GetExtension(dialog.FileName) == ".csv")
                        table = clsFileIO.GetDataTableFromCsv(dialog.FileName);
                    else
                        table = clsFileIO.makeDataTableFromSheetName(dialog.FileName, "Sheet1");

                    this.grv_EmailList.DataSource = null;
                    this.grv_EmailList.DataSource = table;
                }
            }
            catch (Exception exception)
            {
                this.LogTextEvent(this.txtLogs, Color.Red, exception.ToString());
            }
        }

        private void btnLoadConfig_Click(object sender, EventArgs e)
        {
            this.loadConfig();
        }

        private void btnLoadTemplate_Click(object sender, EventArgs e)
        {
            try
            {
                OpenFileDialog dialog = new OpenFileDialog
                {
                    Title = "Open Text File",
                    Filter = "Html files (*.html)|*.html|Htm files (*.htm)|*.htm",
                    InitialDirectory = @"C:\"
                };
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    string filename = dialog.FileName.ToString();
                    this.txtContent.setHTML("");
                    this.txtContent.setHTML(clsFileIO.readHtmlFile(filename));
                }
            }
            catch (Exception exception)
            {
                this.LogTextEvent(this.txtLogs, Color.Red, exception.ToString());
            }
        }

        private void btnSaveConfig_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable table = new DataTable();
                table.Columns.Add("SmtpUsername", typeof(string));
                table.Columns.Add("SmtpPassword", typeof(string));
                table.Columns.Add("SmtpHost", typeof(string));
                table.Columns.Add("SendName", typeof(string));
                table.Columns.Add("SendEmail", typeof(string));
                table.Rows.Add(new object[] { this.txtUserName.Text.Trim(), this.txtPassWord.Text.Trim(), this.txtHostEmail.Text.Trim(), this.txtSendName.Text.Trim(), this.txtSendMail.Text.Trim() });
                table.TableName = "AcountConfig";
                table.WriteXml("AcountConfig.xml", XmlWriteMode.WriteSchema);
                MessageBox.Show("Save successfully");
            }
            catch (Exception exception)
            {
                this.LogTextEvent(this.txtLogs, Color.Red, exception.ToString());
            }
        }

        private void btnSaveEmail_Click(object sender, EventArgs e)
        {
            SaveFileDialog dialog = new SaveFileDialog
            {
                Filter = "Excel Documents (*.xls)|*.xls",
                FileName = "export.xls"
            };
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                clsFileIO.ToCsV(this.grv_EmailList, dialog.FileName);
            }
        }

        private void btnSaveTemplate_Click(object sender, EventArgs e)
        {
            SaveFileDialog dialog = new SaveFileDialog
            {
                DefaultExt = "html",
                Title = "Save as html file",
                Filter = "Html files (*.html)|*.html"
            };
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                File.WriteAllText(dialog.FileName, this.txtContent.getHTML(), Encoding.UTF8);
            }
        }

        private void btnSendAllMail_Click(object sender, EventArgs e)
        {
            if (this.loadConfig() && (MessageBox.Show("Really Send Mail?", "Confirm Send Mail", MessageBoxButtons.YesNo) == DialogResult.Yes))
            {
                this.xSendAllMail();
            }
        }

        private void btnTestSendMail_Click(object sender, EventArgs e)
        {
            new testSendMail(this.txtSubject.Text, this.txtContent.getHTML()).ShowDialog();
        }

        public DataTable DataGridView2DataTable(DataGridView dgv, string tblName, int minRow = 0)
        {
            int num;
            DataRow row2;
            int num2;
            DataTable table = new DataTable(tblName);
            foreach (DataGridViewColumn column in dgv.Columns)
            {
                DataColumn column2 = new DataColumn(column.Name.ToString());
                table.Columns.Add(column2);
            }
            for (num = 0; num < dgv.Rows.Count; num++)
            {
                DataGridViewRow row = dgv.Rows[num];
                row2 = table.NewRow();
                num2 = 0;
                while (num2 < dgv.Columns.Count)
                {
                    row2[num2] = (row.Cells[num2].Value == null) ? "" : row.Cells[num2].Value.ToString();
                    num2++;
                }
                table.Rows.Add(row2);
            }
            for (num = dgv.Rows.Count; num < minRow; num++)
            {
                row2 = table.NewRow();
                for (num2 = 0; num2 < table.Columns.Count; num2++)
                {
                    row2[num2] = "\x00a0 ";
                }
                table.Rows.Add(row2);
            }
            return table;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private static DataTable GetTable()
        {
            DataTable table = new DataTable();
            table.Columns.Add("Email", typeof(string));
            table.Columns.Add("Name", typeof(string));
            table.Rows.Add(new object[] { "ExampleEmail@gmail.com", "Example Name" });
            return table;
        }

        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(main));
            this.metroShell1 = new DevComponents.DotNetBar.Metro.MetroShell();
            this.metroTabPanel1 = new DevComponents.DotNetBar.Metro.MetroTabPanel();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.txtLogs = new System.Windows.Forms.RichTextBox();
            this.panel2 = new System.Windows.Forms.Panel();
            this.txtSubject = new System.Windows.Forms.TextBox();
            this.txtContent = new HTMLWYSIWYG.htmlwysiwyg();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.labelX5 = new DevComponents.DotNetBar.LabelX();
            this.btnSendAllMail = new DevComponents.DotNetBar.ButtonX();
            this.btnTestSendMail = new DevComponents.DotNetBar.ButtonX();
            this.btnSaveTemplate = new DevComponents.DotNetBar.ButtonX();
            this.btnLoadTemplate = new DevComponents.DotNetBar.ButtonX();
            this.panel1 = new System.Windows.Forms.Panel();
            this.btnDelete = new DevComponents.DotNetBar.ButtonX();
            this.btnSaveEmail = new DevComponents.DotNetBar.ButtonX();
            this.btnImportEmail = new DevComponents.DotNetBar.ButtonX();
            this.grv_EmailList = new System.Windows.Forms.DataGridView();
            this.Email_User = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Name_User = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.statusStrip1 = new System.Windows.Forms.StatusStrip();
            this.lblStatusSendMail = new System.Windows.Forms.ToolStripStatusLabel();
            this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
            this.toolStripProgressBar1 = new System.Windows.Forms.ToolStripProgressBar();
            this.metroTabPanel2 = new DevComponents.DotNetBar.Metro.MetroTabPanel();
            this.btnSaveConfig = new DevComponents.DotNetBar.ButtonX();
            this.btnClear = new DevComponents.DotNetBar.ButtonX();
            this.btnLoadConfig = new DevComponents.DotNetBar.ButtonX();
            this.groupPanel2 = new DevComponents.DotNetBar.Controls.GroupPanel();
            this.labelX4 = new DevComponents.DotNetBar.LabelX();
            this.txtSendName = new DevComponents.DotNetBar.Controls.TextBoxX();
            this.labelX6 = new DevComponents.DotNetBar.LabelX();
            this.txtSendMail = new DevComponents.DotNetBar.Controls.TextBoxX();
            this.groupPanel3 = new DevComponents.DotNetBar.Controls.GroupPanel();
            this.labelX7 = new DevComponents.DotNetBar.LabelX();
            this.labelX8 = new DevComponents.DotNetBar.LabelX();
            this.textBoxX1 = new DevComponents.DotNetBar.Controls.TextBoxX();
            this.labelX9 = new DevComponents.DotNetBar.LabelX();
            this.textBoxX2 = new DevComponents.DotNetBar.Controls.TextBoxX();
            this.textBoxX3 = new DevComponents.DotNetBar.Controls.TextBoxX();
            this.groupPanel1 = new DevComponents.DotNetBar.Controls.GroupPanel();
            this.labelX1 = new DevComponents.DotNetBar.LabelX();
            this.labelX3 = new DevComponents.DotNetBar.LabelX();
            this.txtUserName = new DevComponents.DotNetBar.Controls.TextBoxX();
            this.labelX2 = new DevComponents.DotNetBar.LabelX();
            this.txtPassWord = new DevComponents.DotNetBar.Controls.TextBoxX();
            this.txtHostEmail = new DevComponents.DotNetBar.Controls.TextBoxX();
            this.metroTabPanel3 = new DevComponents.DotNetBar.Metro.MetroTabPanel();
            this.webBrowser1 = new System.Windows.Forms.WebBrowser();
            this.tab_mailer = new DevComponents.DotNetBar.Metro.MetroTabItem();
            this.tab_config = new DevComponents.DotNetBar.Metro.MetroTabItem();
            this.tab_about = new DevComponents.DotNetBar.Metro.MetroTabItem();
            this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem();
            this.qatCustomizeItem1 = new DevComponents.DotNetBar.QatCustomizeItem();
            this.metroShell1.SuspendLayout();
            this.metroTabPanel1.SuspendLayout();
            this.groupBox1.SuspendLayout();
            this.panel2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.panel1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.grv_EmailList)).BeginInit();
            this.statusStrip1.SuspendLayout();
            this.metroTabPanel2.SuspendLayout();
            this.groupPanel2.SuspendLayout();
            this.groupPanel3.SuspendLayout();
            this.groupPanel1.SuspendLayout();
            this.metroTabPanel3.SuspendLayout();
            this.SuspendLayout();
            // 
            // metroShell1
            // 
            this.metroShell1.BackColor = System.Drawing.Color.White;
            // 
            // 
            // 
            this.metroShell1.BackgroundStyle.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.metroShell1.BackgroundStyle.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.metroShell1.BackgroundStyle.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.metroShell1.BackgroundStyle.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.metroShell1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.metroShell1.BackgroundStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(163)));
            this.metroShell1.BackgroundStyle.TextShadowColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarCaptionInactiveText;
            this.metroShell1.BackgroundStyle.TextShadowOffset = new System.Drawing.Point(3, 2);
            this.metroShell1.Controls.Add(this.metroTabPanel1);
            this.metroShell1.Controls.Add(this.metroTabPanel2);
            this.metroShell1.Controls.Add(this.metroTabPanel3);
            this.metroShell1.Dock = System.Windows.Forms.DockStyle.Top;
            this.metroShell1.Font = new System.Drawing.Font("Segoe UI Symbol", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.metroShell1.ForeColor = System.Drawing.Color.Black;
            this.metroShell1.HelpButtonText = null;
            this.metroShell1.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
            this.tab_mailer,
            this.tab_config,
            this.tab_about});
            this.metroShell1.KeyTipsFont = new System.Drawing.Font("Tahoma", 7F);
            this.metroShell1.Location = new System.Drawing.Point(0, 0);
            this.metroShell1.Name = "metroShell1";
            this.metroShell1.QuickToolbarItems.AddRange(new DevComponents.DotNetBar.BaseItem[] {
            this.buttonItem1,
            this.qatCustomizeItem1});
            this.metroShell1.Size = new System.Drawing.Size(932, 533);
            this.metroShell1.SystemText.MaximizeRibbonText = "&Maximize the Ribbon";
            this.metroShell1.SystemText.MinimizeRibbonText = "Mi&nimize the Ribbon";
            this.metroShell1.SystemText.QatAddItemText = "&Add to Quick Access Toolbar";
            this.metroShell1.SystemText.QatCustomizeMenuLabel = "<b>Customize Quick Access Toolbar</b>";
            this.metroShell1.SystemText.QatCustomizeText = "&Customize Quick Access Toolbar...";
            this.metroShell1.SystemText.QatDialogAddButton = "&Add >>";
            this.metroShell1.SystemText.QatDialogCancelButton = "Cancel";
            this.metroShell1.SystemText.QatDialogCaption = "Customize Quick Access Toolbar";
            this.metroShell1.SystemText.QatDialogCategoriesLabel = "&Choose commands from:";
            this.metroShell1.SystemText.QatDialogOkButton = "OK";
            this.metroShell1.SystemText.QatDialogPlacementCheckbox = "&Place Quick Access Toolbar below the Ribbon";
            this.metroShell1.SystemText.QatDialogRemoveButton = "&Remove";
            this.metroShell1.SystemText.QatPlaceAboveRibbonText = "&Place Quick Access Toolbar above the Ribbon";
            this.metroShell1.SystemText.QatPlaceBelowRibbonText = "&Place Quick Access Toolbar below the Ribbon";
            this.metroShell1.SystemText.QatRemoveItemText = "&Remove from Quick Access Toolbar";
            this.metroShell1.TabIndex = 0;
            this.metroShell1.TabStripFont = new System.Drawing.Font("Segoe UI", 10.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.metroShell1.Text = "metroShell1";
            // 
            // metroTabPanel1
            // 
            this.metroTabPanel1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            this.metroTabPanel1.Controls.Add(this.groupBox1);
            this.metroTabPanel1.Controls.Add(this.panel2);
            this.metroTabPanel1.Controls.Add(this.panel1);
            this.metroTabPanel1.Controls.Add(this.statusStrip1);
            this.metroTabPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.metroTabPanel1.Location = new System.Drawing.Point(0, 26);
            this.metroTabPanel1.Name = "metroTabPanel1";
            this.metroTabPanel1.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3);
            this.metroTabPanel1.Size = new System.Drawing.Size(932, 507);
            // 
            // 
            // 
            this.metroTabPanel1.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            // 
            // 
            // 
            this.metroTabPanel1.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            // 
            // 
            // 
            this.metroTabPanel1.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.metroTabPanel1.TabIndex = 1;
            this.metroTabPanel1.Visible = true;
            // 
            // groupBox1
            // 
            this.groupBox1.BackColor = System.Drawing.Color.White;
            this.groupBox1.Controls.Add(this.txtLogs);
            this.groupBox1.ForeColor = System.Drawing.Color.Black;
            this.groupBox1.Location = new System.Drawing.Point(272, 343);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(660, 127);
            this.groupBox1.TabIndex = 3;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Logs:";
            // 
            // txtLogs
            // 
            this.txtLogs.BackColor = System.Drawing.Color.White;
            this.txtLogs.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.txtLogs.ForeColor = System.Drawing.Color.Black;
            this.txtLogs.Location = new System.Drawing.Point(6, 21);
            this.txtLogs.Name = "txtLogs";
            this.txtLogs.ReadOnly = true;
            this.txtLogs.Size = new System.Drawing.Size(648, 96);
            this.txtLogs.TabIndex = 0;
            this.txtLogs.Text = "";
            // 
            // panel2
            // 
            this.panel2.BackColor = System.Drawing.Color.Transparent;
            this.panel2.Controls.Add(this.txtSubject);
            this.panel2.Controls.Add(this.txtContent);
            this.panel2.Controls.Add(this.pictureBox1);
            this.panel2.Controls.Add(this.labelX5);
            this.panel2.Controls.Add(this.btnSendAllMail);
            this.panel2.Controls.Add(this.btnTestSendMail);
            this.panel2.Controls.Add(this.btnSaveTemplate);
            this.panel2.Controls.Add(this.btnLoadTemplate);
            this.panel2.ForeColor = System.Drawing.Color.Black;
            this.panel2.Location = new System.Drawing.Point(272, 3);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(660, 334);
            this.panel2.TabIndex = 2;
            // 
            // txtSubject
            // 
            this.txtSubject.Location = new System.Drawing.Point(55, 46);
            this.txtSubject.MaximumSize = new System.Drawing.Size(516, 24);
            this.txtSubject.MinimumSize = new System.Drawing.Size(516, 24);
            this.txtSubject.Name = "txtSubject";
            this.txtSubject.Size = new System.Drawing.Size(516, 24);
            this.txtSubject.TabIndex = 9;
            // 
            // txtContent
            // 
            this.txtContent.AutoScroll = true;
            this.txtContent.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.txtContent.Changed = false;
            this.txtContent.Location = new System.Drawing.Point(0, 76);
            this.txtContent.Name = "txtContent";
            this.txtContent.ShowAlignCenterButton = true;
            this.txtContent.ShowAlignLeftButton = true;
            this.txtContent.ShowAlignRightButton = true;
            this.txtContent.ShowBackColorButton = true;
            this.txtContent.ShowBolButton = true;
            this.txtContent.ShowBulletButton = true;
            this.txtContent.ShowCopyButton = true;
            this.txtContent.ShowCutButton = true;
            this.txtContent.ShowFontFamilyButton = true;
            this.txtContent.ShowFontSizeButton = true;
            this.txtContent.ShowIndentButton = true;
            this.txtContent.ShowItalicButton = true;
            this.txtContent.ShowJustifyButton = true;
            this.txtContent.ShowLinkButton = true;
            this.txtContent.ShowNewButton = true;
            this.txtContent.ShowOrderedListButton = true;
            this.txtContent.ShowOutdentButton = true;
            this.txtContent.ShowPasteButton = true;
            this.txtContent.ShowPrintButton = false;
            this.txtContent.ShowTxtBGButton = true;
            this.txtContent.ShowTxtColorButton = true;
            this.txtContent.ShowUnderlineButton = true;
            this.txtContent.ShowUnlinkButton = true;
            this.txtContent.Size = new System.Drawing.Size(660, 258);
            this.txtContent.TabIndex = 8;
            // 
            // pictureBox1
            // 
            this.pictureBox1.Image = global::Properties.Resources.icon;
            this.pictureBox1.Location = new System.Drawing.Point(577, 3);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(70, 67);
            this.pictureBox1.TabIndex = 7;
            this.pictureBox1.TabStop = false;
            // 
            // labelX5
            // 
            this.labelX5.BackColor = System.Drawing.Color.White;
            // 
            // 
            // 
            this.labelX5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.labelX5.ForeColor = System.Drawing.Color.Black;
            this.labelX5.Location = new System.Drawing.Point(11, 44);
            this.labelX5.Name = "labelX5";
            this.labelX5.Size = new System.Drawing.Size(48, 23);
            this.labelX5.TabIndex = 5;
            this.labelX5.Text = "Subject";
            // 
            // btnSendAllMail
            // 
            this.btnSendAllMail.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
            this.btnSendAllMail.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.btnSendAllMail.Font = new System.Drawing.Font("Segoe UI Symbol", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnSendAllMail.Location = new System.Drawing.Point(323, 3);
            this.btnSendAllMail.Name = "btnSendAllMail";
            this.btnSendAllMail.Size = new System.Drawing.Size(100, 35);
            this.btnSendAllMail.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            this.btnSendAllMail.TabIndex = 1;
            this.btnSendAllMail.Text = "SEND ALL MAIL";
            this.btnSendAllMail.Click += new System.EventHandler(this.btnSendAllMail_Click);
            // 
            // btnTestSendMail
            // 
            this.btnTestSendMail.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
            this.btnTestSendMail.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.btnTestSendMail.Location = new System.Drawing.Point(217, 3);
            this.btnTestSendMail.Name = "btnTestSendMail";
            this.btnTestSendMail.Size = new System.Drawing.Size(100, 35);
            this.btnTestSendMail.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            this.btnTestSendMail.TabIndex = 1;
            this.btnTestSendMail.Text = "Test Send Email";
            this.btnTestSendMail.Click += new System.EventHandler(this.btnTestSendMail_Click);
            // 
            // btnSaveTemplate
            // 
            this.btnSaveTemplate.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
            this.btnSaveTemplate.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.btnSaveTemplate.Location = new System.Drawing.Point(111, 3);
            this.btnSaveTemplate.Name = "btnSaveTemplate";
            this.btnSaveTemplate.Size = new System.Drawing.Size(100, 35);
            this.btnSaveTemplate.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            this.btnSaveTemplate.TabIndex = 1;
            this.btnSaveTemplate.Text = "Save Template";
            this.btnSaveTemplate.Click += new System.EventHandler(this.btnSaveTemplate_Click);
            // 
            // btnLoadTemplate
            // 
            this.btnLoadTemplate.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
            this.btnLoadTemplate.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.btnLoadTemplate.Location = new System.Drawing.Point(7, 3);
            this.btnLoadTemplate.Name = "btnLoadTemplate";
            this.btnLoadTemplate.Size = new System.Drawing.Size(98, 35);
            this.btnLoadTemplate.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            this.btnLoadTemplate.TabIndex = 1;
            this.btnLoadTemplate.Text = "Load template";
            this.btnLoadTemplate.Click += new System.EventHandler(this.btnLoadTemplate_Click);
            // 
            // panel1
            // 
            this.panel1.BackColor = System.Drawing.Color.Transparent;
            this.panel1.Controls.Add(this.btnDelete);
            this.panel1.Controls.Add(this.btnSaveEmail);
            this.panel1.Controls.Add(this.btnImportEmail);
            this.panel1.Controls.Add(this.grv_EmailList);
            this.panel1.ForeColor = System.Drawing.Color.Black;
            this.panel1.Location = new System.Drawing.Point(12, 3);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(254, 467);
            this.panel1.TabIndex = 1;
            // 
            // btnDelete
            // 
            this.btnDelete.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
            this.btnDelete.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.btnDelete.Location = new System.Drawing.Point(89, 3);
            this.btnDelete.Name = "btnDelete";
            this.btnDelete.Size = new System.Drawing.Size(75, 35);
            this.btnDelete.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            this.btnDelete.TabIndex = 1;
            this.btnDelete.Text = "Delete";
            // 
            // btnSaveEmail
            // 
            this.btnSaveEmail.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
            this.btnSaveEmail.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.btnSaveEmail.Location = new System.Drawing.Point(170, 3);
            this.btnSaveEmail.Name = "btnSaveEmail";
            this.btnSaveEmail.Size = new System.Drawing.Size(81, 35);
            this.btnSaveEmail.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            this.btnSaveEmail.TabIndex = 1;
            this.btnSaveEmail.Text = "Save Email";
            this.btnSaveEmail.Click += new System.EventHandler(this.btnSaveEmail_Click);
            // 
            // btnImportEmail
            // 
            this.btnImportEmail.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
            this.btnImportEmail.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.btnImportEmail.Location = new System.Drawing.Point(3, 3);
            this.btnImportEmail.Name = "btnImportEmail";
            this.btnImportEmail.Size = new System.Drawing.Size(80, 35);
            this.btnImportEmail.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            this.btnImportEmail.TabIndex = 1;
            this.btnImportEmail.Text = "Import Email";
            this.btnImportEmail.Click += new System.EventHandler(this.btnImportEmail_Click);
            // 
            // grv_EmailList
            // 
            this.grv_EmailList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.grv_EmailList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.Email_User,
            this.Name_User});
            this.grv_EmailList.Location = new System.Drawing.Point(3, 44);
            this.grv_EmailList.Name = "grv_EmailList";
            this.grv_EmailList.Size = new System.Drawing.Size(248, 420);
            this.grv_EmailList.TabIndex = 0;
            // 
            // Email_User
            // 
            this.Email_User.DataPropertyName = "email";
            this.Email_User.FillWeight = 150F;
            this.Email_User.HeaderText = "Email";
            this.Email_User.Name = "Email_User";
            this.Email_User.Width = 150;
            // 
            // Name_User
            // 
            this.Name_User.DataPropertyName = "name";
            this.Name_User.HeaderText = "Name";
            this.Name_User.Name = "Name_User";
            // 
            // statusStrip1
            // 
            this.statusStrip1.BackColor = System.Drawing.Color.White;
            this.statusStrip1.ForeColor = System.Drawing.Color.Black;
            this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.lblStatusSendMail,
            this.toolStripStatusLabel2,
            this.toolStripProgressBar1});
            this.statusStrip1.Location = new System.Drawing.Point(3, 473);
            this.statusStrip1.Name = "statusStrip1";
            this.statusStrip1.Size = new System.Drawing.Size(926, 31);
            this.statusStrip1.TabIndex = 0;
            this.statusStrip1.Text = "statusStrip1";
            // 
            // lblStatusSendMail
            // 
            this.lblStatusSendMail.AutoSize = false;
            this.lblStatusSendMail.Name = "lblStatusSendMail";
            this.lblStatusSendMail.Size = new System.Drawing.Size(200, 26);
            this.lblStatusSendMail.Text = "Send Email Amazon Pro";
            // 
            // toolStripStatusLabel2
            // 
            this.toolStripStatusLabel2.AutoSize = false;
            this.toolStripStatusLabel2.IsLink = true;
            this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
            this.toolStripStatusLabel2.Size = new System.Drawing.Size(200, 26);
            this.toolStripStatusLabel2.Text = "http://thegioiphaidep.vn";
            // 
            // toolStripProgressBar1
            // 
            this.toolStripProgressBar1.BackColor = System.Drawing.Color.White;
            this.toolStripProgressBar1.ForeColor = System.Drawing.Color.Black;
            this.toolStripProgressBar1.Name = "toolStripProgressBar1";
            this.toolStripProgressBar1.Size = new System.Drawing.Size(500, 25);
            this.toolStripProgressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
            // 
            // metroTabPanel2
            // 
            this.metroTabPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            this.metroTabPanel2.Controls.Add(this.btnSaveConfig);
            this.metroTabPanel2.Controls.Add(this.btnClear);
            this.metroTabPanel2.Controls.Add(this.btnLoadConfig);
            this.metroTabPanel2.Controls.Add(this.groupPanel2);
            this.metroTabPanel2.Controls.Add(this.groupPanel3);
            this.metroTabPanel2.Controls.Add(this.groupPanel1);
            this.metroTabPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.metroTabPanel2.Location = new System.Drawing.Point(0, 26);
            this.metroTabPanel2.Name = "metroTabPanel2";
            this.metroTabPanel2.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3);
            this.metroTabPanel2.Size = new System.Drawing.Size(932, 507);
            // 
            // 
            // 
            this.metroTabPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            // 
            // 
            // 
            this.metroTabPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            // 
            // 
            // 
            this.metroTabPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.metroTabPanel2.TabIndex = 2;
            this.metroTabPanel2.Visible = false;
            // 
            // btnSaveConfig
            // 
            this.btnSaveConfig.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
            this.btnSaveConfig.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.btnSaveConfig.Font = new System.Drawing.Font("Segoe UI Symbol", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnSaveConfig.Location = new System.Drawing.Point(711, 114);
            this.btnSaveConfig.Name = "btnSaveConfig";
            this.btnSaveConfig.Size = new System.Drawing.Size(100, 35);
            this.btnSaveConfig.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            this.btnSaveConfig.TabIndex = 3;
            this.btnSaveConfig.Text = "SAVE";
            this.btnSaveConfig.Click += new System.EventHandler(this.btnSaveConfig_Click);
            // 
            // btnClear
            // 
            this.btnClear.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
            this.btnClear.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.btnClear.Location = new System.Drawing.Point(499, 114);
            this.btnClear.Name = "btnClear";
            this.btnClear.Size = new System.Drawing.Size(100, 35);
            this.btnClear.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            this.btnClear.TabIndex = 4;
            this.btnClear.Text = "Clear";
            this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
            // 
            // btnLoadConfig
            // 
            this.btnLoadConfig.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
            this.btnLoadConfig.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
            this.btnLoadConfig.Location = new System.Drawing.Point(605, 114);
            this.btnLoadConfig.Name = "btnLoadConfig";
            this.btnLoadConfig.Size = new System.Drawing.Size(100, 35);
            this.btnLoadConfig.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            this.btnLoadConfig.TabIndex = 4;
            this.btnLoadConfig.Text = "ReLoad Config";
            this.btnLoadConfig.Click += new System.EventHandler(this.btnLoadConfig_Click);
            // 
            // groupPanel2
            // 
            this.groupPanel2.BackColor = System.Drawing.Color.White;
            this.groupPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
            this.groupPanel2.Controls.Add(this.labelX4);
            this.groupPanel2.Controls.Add(this.txtSendName);
            this.groupPanel2.Controls.Add(this.labelX6);
            this.groupPanel2.Controls.Add(this.txtSendMail);
            this.groupPanel2.Location = new System.Drawing.Point(426, 9);
            this.groupPanel2.Name = "groupPanel2";
            this.groupPanel2.Size = new System.Drawing.Size(385, 99);
            // 
            // 
            // 
            this.groupPanel2.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
            this.groupPanel2.Style.BackColorGradientAngle = 90;
            this.groupPanel2.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
            this.groupPanel2.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.groupPanel2.Style.BorderBottomWidth = 1;
            this.groupPanel2.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
            this.groupPanel2.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.groupPanel2.Style.BorderLeftWidth = 1;
            this.groupPanel2.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.groupPanel2.Style.BorderRightWidth = 1;
            this.groupPanel2.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.groupPanel2.Style.BorderTopWidth = 1;
            this.groupPanel2.Style.CornerDiameter = 4;
            this.groupPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
            this.groupPanel2.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
            this.groupPanel2.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
            this.groupPanel2.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
            // 
            // 
            // 
            this.groupPanel2.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            // 
            // 
            // 
            this.groupPanel2.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.groupPanel2.TabIndex = 2;
            this.groupPanel2.Text = "Email Config";
            // 
            // labelX4
            // 
            this.labelX4.BackColor = System.Drawing.Color.Transparent;
            // 
            // 
            // 
            this.labelX4.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.labelX4.ForeColor = System.Drawing.Color.Black;
            this.labelX4.Location = new System.Drawing.Point(15, 12);
            this.labelX4.Name = "labelX4";
            this.labelX4.Size = new System.Drawing.Size(104, 23);
            this.labelX4.TabIndex = 1;
            this.labelX4.Text = "Send Name:";
            this.labelX4.TextAlignment = System.Drawing.StringAlignment.Far;
            // 
            // txtSendName
            // 
            this.txtSendName.BackColor = System.Drawing.Color.White;
            // 
            // 
            // 
            this.txtSendName.Border.Class = "TextBoxBorder";
            this.txtSendName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.txtSendName.ForeColor = System.Drawing.Color.Black;
            this.txtSendName.Location = new System.Drawing.Point(125, 15);
            this.txtSendName.Name = "txtSendName";
            this.txtSendName.Size = new System.Drawing.Size(243, 22);
            this.txtSendName.TabIndex = 0;
            // 
            // labelX6
            // 
            this.labelX6.BackColor = System.Drawing.Color.Transparent;
            // 
            // 
            // 
            this.labelX6.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.labelX6.ForeColor = System.Drawing.Color.Black;
            this.labelX6.Location = new System.Drawing.Point(15, 40);
            this.labelX6.Name = "labelX6";
            this.labelX6.Size = new System.Drawing.Size(104, 23);
            this.labelX6.Style = DevComponents.DotNetBar.eDotNetBarStyle.Windows7;
            this.labelX6.TabIndex = 1;
            this.labelX6.Text = "Send Email :";
            this.labelX6.TextAlignment = System.Drawing.StringAlignment.Far;
            // 
            // txtSendMail
            // 
            this.txtSendMail.BackColor = System.Drawing.Color.White;
            // 
            // 
            // 
            this.txtSendMail.Border.Class = "TextBoxBorder";
            this.txtSendMail.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.txtSendMail.ForeColor = System.Drawing.Color.Black;
            this.txtSendMail.Location = new System.Drawing.Point(125, 43);
            this.txtSendMail.Name = "txtSendMail";
            this.txtSendMail.Size = new System.Drawing.Size(243, 22);
            this.txtSendMail.TabIndex = 0;
            // 
            // groupPanel3
            // 
            this.groupPanel3.BackColor = System.Drawing.Color.White;
            this.groupPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
            this.groupPanel3.Controls.Add(this.labelX7);
            this.groupPanel3.Controls.Add(this.labelX8);
            this.groupPanel3.Controls.Add(this.textBoxX1);
            this.groupPanel3.Controls.Add(this.labelX9);
            this.groupPanel3.Controls.Add(this.textBoxX2);
            this.groupPanel3.Controls.Add(this.textBoxX3);
            this.groupPanel3.Location = new System.Drawing.Point(12, 147);
            this.groupPanel3.Name = "groupPanel3";
            this.groupPanel3.Size = new System.Drawing.Size(385, 132);
            // 
            // 
            // 
            this.groupPanel3.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
            this.groupPanel3.Style.BackColorGradientAngle = 90;
            this.groupPanel3.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
            this.groupPanel3.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.groupPanel3.Style.BorderBottomWidth = 1;
            this.groupPanel3.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
            this.groupPanel3.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.groupPanel3.Style.BorderLeftWidth = 1;
            this.groupPanel3.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.groupPanel3.Style.BorderRightWidth = 1;
            this.groupPanel3.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.groupPanel3.Style.BorderTopWidth = 1;
            this.groupPanel3.Style.CornerDiameter = 4;
            this.groupPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
            this.groupPanel3.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
            this.groupPanel3.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
            this.groupPanel3.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
            // 
            // 
            // 
            this.groupPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            // 
            // 
            // 
            this.groupPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.groupPanel3.TabIndex = 2;
            this.groupPanel3.Text = "Example SMTP host";
            // 
            // labelX7
            // 
            this.labelX7.BackColor = System.Drawing.Color.Transparent;
            // 
            // 
            // 
            this.labelX7.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.labelX7.ForeColor = System.Drawing.Color.Black;
            this.labelX7.Location = new System.Drawing.Point(15, 12);
            this.labelX7.Name = "labelX7";
            this.labelX7.Size = new System.Drawing.Size(104, 23);
            this.labelX7.TabIndex = 1;
            this.labelX7.Text = "Smtp Gmail :";
            this.labelX7.TextAlignment = System.Drawing.StringAlignment.Far;
            // 
            // labelX8
            // 
            this.labelX8.BackColor = System.Drawing.Color.Transparent;
            // 
            // 
            // 
            this.labelX8.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.labelX8.ForeColor = System.Drawing.Color.Black;
            this.labelX8.Location = new System.Drawing.Point(15, 68);
            this.labelX8.Name = "labelX8";
            this.labelX8.Size = new System.Drawing.Size(104, 23);
            this.labelX8.Style = DevComponents.DotNetBar.eDotNetBarStyle.Windows7;
            this.labelX8.TabIndex = 1;
            this.labelX8.Text = "Smtp Amazon :";
            this.labelX8.TextAlignment = System.Drawing.StringAlignment.Far;
            // 
            // textBoxX1
            // 
            this.textBoxX1.BackColor = System.Drawing.Color.Silver;
            // 
            // 
            // 
            this.textBoxX1.Border.Class = "TextBoxBorder";
            this.textBoxX1.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.textBoxX1.ForeColor = System.Drawing.Color.Black;
            this.textBoxX1.Location = new System.Drawing.Point(125, 15);
            this.textBoxX1.Name = "textBoxX1";
            this.textBoxX1.ReadOnly = true;
            this.textBoxX1.Size = new System.Drawing.Size(243, 22);
            this.textBoxX1.TabIndex = 0;
            this.textBoxX1.Text = "smtp.gmail.com";
            // 
            // labelX9
            // 
            this.labelX9.BackColor = System.Drawing.Color.Transparent;
            // 
            // 
            // 
            this.labelX9.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.labelX9.ForeColor = System.Drawing.Color.Black;
            this.labelX9.Location = new System.Drawing.Point(15, 40);
            this.labelX9.Name = "labelX9";
            this.labelX9.Size = new System.Drawing.Size(104, 23);
            this.labelX9.Style = DevComponents.DotNetBar.eDotNetBarStyle.Windows7;
            this.labelX9.TabIndex = 1;
            this.labelX9.Text = "Smtp Yahoo :";
            this.labelX9.TextAlignment = System.Drawing.StringAlignment.Far;
            // 
            // textBoxX2
            // 
            this.textBoxX2.BackColor = System.Drawing.Color.Silver;
            // 
            // 
            // 
            this.textBoxX2.Border.Class = "TextBoxBorder";
            this.textBoxX2.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.textBoxX2.ForeColor = System.Drawing.Color.Black;
            this.textBoxX2.Location = new System.Drawing.Point(125, 43);
            this.textBoxX2.Name = "textBoxX2";
            this.textBoxX2.ReadOnly = true;
            this.textBoxX2.Size = new System.Drawing.Size(243, 22);
            this.textBoxX2.TabIndex = 0;
            this.textBoxX2.Text = "smtp.mail.yahoo.com";
            // 
            // textBoxX3
            // 
            this.textBoxX3.BackColor = System.Drawing.Color.Silver;
            // 
            // 
            // 
            this.textBoxX3.Border.Class = "TextBoxBorder";
            this.textBoxX3.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.textBoxX3.ForeColor = System.Drawing.Color.Black;
            this.textBoxX3.Location = new System.Drawing.Point(125, 71);
            this.textBoxX3.Name = "textBoxX3";
            this.textBoxX3.ReadOnly = true;
            this.textBoxX3.Size = new System.Drawing.Size(243, 22);
            this.textBoxX3.TabIndex = 0;
            this.textBoxX3.Text = "email-smtp.us-east-1.amazonaws.com";
            // 
            // groupPanel1
            // 
            this.groupPanel1.BackColor = System.Drawing.Color.White;
            this.groupPanel1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
            this.groupPanel1.Controls.Add(this.labelX1);
            this.groupPanel1.Controls.Add(this.labelX3);
            this.groupPanel1.Controls.Add(this.txtUserName);
            this.groupPanel1.Controls.Add(this.labelX2);
            this.groupPanel1.Controls.Add(this.txtPassWord);
            this.groupPanel1.Controls.Add(this.txtHostEmail);
            this.groupPanel1.Location = new System.Drawing.Point(12, 9);
            this.groupPanel1.Name = "groupPanel1";
            this.groupPanel1.Size = new System.Drawing.Size(385, 132);
            // 
            // 
            // 
            this.groupPanel1.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;
            this.groupPanel1.Style.BackColorGradientAngle = 90;
            this.groupPanel1.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
            this.groupPanel1.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.groupPanel1.Style.BorderBottomWidth = 1;
            this.groupPanel1.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
            this.groupPanel1.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.groupPanel1.Style.BorderLeftWidth = 1;
            this.groupPanel1.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.groupPanel1.Style.BorderRightWidth = 1;
            this.groupPanel1.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;
            this.groupPanel1.Style.BorderTopWidth = 1;
            this.groupPanel1.Style.CornerDiameter = 4;
            this.groupPanel1.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;
            this.groupPanel1.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
            this.groupPanel1.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
            this.groupPanel1.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
            // 
            // 
            // 
            this.groupPanel1.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            // 
            // 
            // 
            this.groupPanel1.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.groupPanel1.TabIndex = 2;
            this.groupPanel1.Text = "Server Config";
            // 
            // labelX1
            // 
            this.labelX1.BackColor = System.Drawing.Color.Transparent;
            // 
            // 
            // 
            this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.labelX1.ForeColor = System.Drawing.Color.Black;
            this.labelX1.Location = new System.Drawing.Point(15, 12);
            this.labelX1.Name = "labelX1";
            this.labelX1.Size = new System.Drawing.Size(104, 23);
            this.labelX1.TabIndex = 1;
            this.labelX1.Text = "Smtp Username :";
            this.labelX1.TextAlignment = System.Drawing.StringAlignment.Far;
            // 
            // labelX3
            // 
            this.labelX3.BackColor = System.Drawing.Color.Transparent;
            // 
            // 
            // 
            this.labelX3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.labelX3.ForeColor = System.Drawing.Color.Black;
            this.labelX3.Location = new System.Drawing.Point(15, 68);
            this.labelX3.Name = "labelX3";
            this.labelX3.Size = new System.Drawing.Size(104, 23);
            this.labelX3.Style = DevComponents.DotNetBar.eDotNetBarStyle.Windows7;
            this.labelX3.TabIndex = 1;
            this.labelX3.Text = "Smtp Host:";
            this.labelX3.TextAlignment = System.Drawing.StringAlignment.Far;
            // 
            // txtUserName
            // 
            this.txtUserName.BackColor = System.Drawing.Color.White;
            // 
            // 
            // 
            this.txtUserName.Border.Class = "TextBoxBorder";
            this.txtUserName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.txtUserName.ForeColor = System.Drawing.Color.Black;
            this.txtUserName.Location = new System.Drawing.Point(125, 15);
            this.txtUserName.Name = "txtUserName";
            this.txtUserName.Size = new System.Drawing.Size(243, 22);
            this.txtUserName.TabIndex = 0;
            // 
            // labelX2
            // 
            this.labelX2.BackColor = System.Drawing.Color.Transparent;
            // 
            // 
            // 
            this.labelX2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.labelX2.ForeColor = System.Drawing.Color.Black;
            this.labelX2.Location = new System.Drawing.Point(15, 40);
            this.labelX2.Name = "labelX2";
            this.labelX2.Size = new System.Drawing.Size(104, 23);
            this.labelX2.Style = DevComponents.DotNetBar.eDotNetBarStyle.Windows7;
            this.labelX2.TabIndex = 1;
            this.labelX2.Text = "Smtp Password :";
            this.labelX2.TextAlignment = System.Drawing.StringAlignment.Far;
            // 
            // txtPassWord
            // 
            this.txtPassWord.BackColor = System.Drawing.Color.White;
            // 
            // 
            // 
            this.txtPassWord.Border.Class = "TextBoxBorder";
            this.txtPassWord.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.txtPassWord.ForeColor = System.Drawing.Color.Black;
            this.txtPassWord.Location = new System.Drawing.Point(125, 43);
            this.txtPassWord.Name = "txtPassWord";
            this.txtPassWord.Size = new System.Drawing.Size(243, 22);
            this.txtPassWord.TabIndex = 0;
            // 
            // txtHostEmail
            // 
            this.txtHostEmail.BackColor = System.Drawing.Color.White;
            // 
            // 
            // 
            this.txtHostEmail.Border.Class = "TextBoxBorder";
            this.txtHostEmail.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.txtHostEmail.ForeColor = System.Drawing.Color.Black;
            this.txtHostEmail.Location = new System.Drawing.Point(125, 71);
            this.txtHostEmail.Name = "txtHostEmail";
            this.txtHostEmail.Size = new System.Drawing.Size(243, 22);
            this.txtHostEmail.TabIndex = 0;
            // 
            // metroTabPanel3
            // 
            this.metroTabPanel3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
            this.metroTabPanel3.Controls.Add(this.webBrowser1);
            this.metroTabPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
            this.metroTabPanel3.Location = new System.Drawing.Point(0, 26);
            this.metroTabPanel3.Name = "metroTabPanel3";
            this.metroTabPanel3.Padding = new System.Windows.Forms.Padding(3, 0, 3, 3);
            this.metroTabPanel3.Size = new System.Drawing.Size(932, 507);
            // 
            // 
            // 
            this.metroTabPanel3.Style.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            // 
            // 
            // 
            this.metroTabPanel3.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            // 
            // 
            // 
            this.metroTabPanel3.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
            this.metroTabPanel3.TabIndex = 3;
            this.metroTabPanel3.Visible = false;
            // 
            // webBrowser1
            // 
            this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.webBrowser1.Location = new System.Drawing.Point(3, 0);
            this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
            this.webBrowser1.Name = "webBrowser1";
            this.webBrowser1.ScrollBarsEnabled = false;
            this.webBrowser1.Size = new System.Drawing.Size(926, 504);
            this.webBrowser1.TabIndex = 0;
            // 
            // tab_mailer
            // 
            this.tab_mailer.Checked = true;
            this.tab_mailer.Name = "tab_mailer";
            this.tab_mailer.Panel = this.metroTabPanel1;
            this.tab_mailer.Text = "&Mailer";
            // 
            // tab_config
            // 
            this.tab_config.Name = "tab_config";
            this.tab_config.Panel = this.metroTabPanel2;
            this.tab_config.Text = "&Config";
            // 
            // tab_about
            // 
            this.tab_about.Name = "tab_about";
            this.tab_about.Panel = this.metroTabPanel3;
            this.tab_about.Text = "&Support/About Us";
            // 
            // buttonItem1
            // 
            this.buttonItem1.Name = "buttonItem1";
            this.buttonItem1.Text = "buttonItem1";
            // 
            // qatCustomizeItem1
            // 
            this.qatCustomizeItem1.BeginGroup = true;
            this.qatCustomizeItem1.Name = "qatCustomizeItem1";
            // 
            // main
            // 
            this.ClientSize = new System.Drawing.Size(932, 533);
            this.Controls.Add(this.metroShell1);
            this.DoubleBuffered = true;
            this.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximumSize = new System.Drawing.Size(948, 572);
            this.MinimumSize = new System.Drawing.Size(948, 572);
            this.Name = "main";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Send mail Facbook pro";
            this.metroShell1.ResumeLayout(false);
            this.metroShell1.PerformLayout();
            this.metroTabPanel1.ResumeLayout(false);
            this.metroTabPanel1.PerformLayout();
            this.groupBox1.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.panel1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.grv_EmailList)).EndInit();
            this.statusStrip1.ResumeLayout(false);
            this.statusStrip1.PerformLayout();
            this.metroTabPanel2.ResumeLayout(false);
            this.groupPanel2.ResumeLayout(false);
            this.groupPanel3.ResumeLayout(false);
            this.groupPanel1.ResumeLayout(false);
            this.metroTabPanel3.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        private bool loadConfig()
        {
            try
            {
                DataTable table = new DataTable();
                table.ReadXml("AcountConfig.xml");
                if (table == null)
                {
                    return false;
                }
                if (table.Rows.Count < 0)
                {
                    return false;
                }
                this.txtUserName.Text = table.Rows[0][0].ToString();
                this.txtPassWord.Text = table.Rows[0][1].ToString();
                this.txtHostEmail.Text = table.Rows[0][2].ToString();
                this.txtSendName.Text = table.Rows[0][3].ToString();
                this.txtSendMail.Text = table.Rows[0][4].ToString();
                return true;
            }
            catch (Exception)
            {
                MessageBox.Show("Setup Config Mail Server!");
                this.LogTextEvent(this.txtLogs, Color.Red, "Setup Config Mail Server!");
                this.tab_config.Select();
                this.txtUserName.Focus();
                return false;
            }
        }

        public void LogTextEvent(RichTextBox TextEventLog, Color TextColor, string EventText)
        {
            Action method = null;
            if (TextEventLog.InvokeRequired)
            {
                if (method == null)
                {
                    method = () => this.LogTextEvent(TextEventLog, TextColor, EventText);
                }
                TextEventLog.BeginInvoke(method);
            }
            else
            {
                string str = DateTime.Now.ToString("hh:mm:ss tt") + " - ";
                TextEventLog.SelectionStart = TextEventLog.Text.Length;
                TextEventLog.SelectionColor = TextColor;
                if (TextEventLog.Lines.Length == 0)
                {
                    TextEventLog.AppendText(str + EventText);
                    TextEventLog.ScrollToCaret();
                    TextEventLog.AppendText(Environment.NewLine);
                }
                else
                {
                    TextEventLog.AppendText(str + EventText + Environment.NewLine);
                    TextEventLog.ScrollToCaret();
                }
            }
        }

        private void xSendAllMail()
        {
            try
            {
                this.toolStripProgressBar1.Value = 0;
                string strSubject = this.txtSubject.Text.Trim();
                string strContent = this.txtContent.getHTML();
                int count = this.grv_EmailList.Rows.Count;
                this.toolStripProgressBar1.Minimum = 0;
                this.toolStripProgressBar1.Maximum = count;
                this.toolStripProgressBar1.Step = 1;
                for (int i = 0; i < count; i++)
                {
                    try
                    {
                        this.toolStripProgressBar1.Value = i + 1;
                        string str3 = oStringHelper.fncCnvNullToString(this.grv_EmailList.Rows[i].Cells[0].Value);
                        if (!string.IsNullOrEmpty(str3))
                        {
                            string str4;
                            if (clsEmail.sendMailOK(str3, strSubject, strContent))
                            {
                                str4 = string.Concat(new object[] { "Submitted : ", str3, "- ", i + 1, "/", count, " - True" });
                                this.LogTextEvent(this.txtLogs, Color.Green, str4);
                                clsDatabase.fncInsertEmail(str3, "");
                            }
                            else
                            {
                                str4 = string.Concat(new object[] { "Submitted : ", str3, "- ", i + 1, "/", count, " - False" });
                                this.LogTextEvent(this.txtLogs, Color.Red, str4);
                            }
                            Thread.Sleep(100);
                        }
                        Application.DoEvents();
                    }
                    catch (Exception exception1)
                    {
                        this.LogTextEvent(this.txtLogs, Color.Red, exception1.ToString());
                    }
                }
                this.LogTextEvent(this.txtLogs, Color.Black, "Submitted successfully");
            }
            catch (Exception exception2)
            {
                oFileHelper.WriteLogErr(strClassName, "xSendAllMail", exception2.ToString());
            }
        }
    }
}

